from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.urls import path, re_path, include

from . import views

urlpatterns = [
                  path('admin/', admin.site.urls),
                  path('', views.index, name='index'),

                  path('register/', views.register, name='register'),
                  path('register2', views.register2, name='register2'),
                  path('success', views.success, name='success'),
                  # 头像上传
                  path('upload-avatar/', views.upload_avatar, name='upload_avatar'),
                  # 激活链接
                  path('active/', views.active, name='active'),
                  path('login/', views.login, name='login'),
                  path('', views.index, name='index'),
                  path('index/', views.index, name='index'),
                  # 发送邮件 验证码
                  path('send_login_code/', views.send_login_code, name='send_login_code'),
                  # 邮箱登录
                  path('email_login/', views.email_login, name='email_login'),
                  # 找回密码
                  path('findpass/', views.findpass, name='findpass'),
                  # 修改密码
                  path('modifypass/<pk>/', views.modifypass, name='modifypass'),

                  # 退出登录
                  path('logout/', views.logout, name='logout'),

                  re_path('^user/', include('user.urls')),
                  re_path('^res/', include('res.urls')),
                  re_path('^message/', include('message.urls')),
                  re_path('^sse/', include('sse.urls')),
              ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
